using Reflector.CodeModel;

namespace LanguageWriterHelper
{
    public class ReflectorVisitor : VisitorBase
    {
        
        public void Visit(IAssemblyCache value)
        {
            if (value == null)
                return;
        }

        public void Visit(IAssemblyComparer value)
        {
            if (value == null)
                return;
        }

        public void Visit(IAssemblyLocation value)
        {
            if (value == null)
                return;

            WriteStartElement("IAssemblyLocation");
            
            Manager.MetadataVisitor.Visit((IAssemblyReference)value);
            WriteElement("Location", value.Location);

            WriteEndElement();
        }

        public void Visit(IAssemblyLocationCollection value)
        {
            if (value == null || value.Count == 0)
                return;

            WriteStartElement("IAssemblyLocationCollection");

            foreach (IAssemblyLocation assemblyLoc in value)
            {
                Visit(assemblyLoc);
            }
            WriteEndElement();
        }

        public void Visit(IAssemblyManager value)
        {
            if (value == null)
                return;
        }

        public void Visit(IAssemblyResolver value)
        {
            if (value == null)
                return;
        }

        public void Visit(ICustomAttributeProvider value)
        {
            if (value == null || value.Attributes.Count == 0)
                return;

            WriteStartElement("ICustomAttributeProvider");

            WriteStartElement("Attributes");
            Manager.MetadataVisitor.Visit(value.Attributes);
            WriteEndElement();

            WriteEndElement();
        }

        public void Visit(IDocumentationProvider value)
        {
            if (value == null)
                return;
        }

        public void Visit(IFormatter value)
        {
            if (value == null)
                return;
        }

        public void Visit(IGenericArgumentProvider value)
        {
            if (value == null || value.GenericArguments.Count == 0)
                return;
                        
            WriteStartElement("IGenericArgumentProvider");

            WriteStartElement("GenericArguments");
            Manager.MetadataVisitor.Visit(value.GenericArguments);
            WriteEndElement();

            WriteEndElement();
        }

        public void Visit(IVisibilityConfiguration value)
        {
            if (value == null)
                return;
        }
        
    }
}
